package homework.homework2;

import javax.swing.*;
import java.awt.*;

public class FloodrPan extends JPanel {
    private final UpPan up;
    private JButton b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15
            , b16, b17, b18, b19, b20;

   // private MouseEveLis me;

    public FloodrPan(UpPan up){
        this.up = up;

        this.setLayout(new GridLayout(5, 4));
        this.setBounds(0, 70, 480, 380);
      //  this.setBackground(Color.RED);

        b1 = new JButton("(");
        b2 = new JButton(")");
        b3 = new JButton("←");
        b4 = new JButton("÷");
        b5 = new JButton("7");
        b6 = new JButton("8");
        b7 = new JButton("9");
        b8 = new JButton("x");
        b9 = new JButton("4");
        b10 = new JButton("5");
        b11 = new JButton("6");
        b12 = new JButton("-");
        b13 = new JButton("1");
        b14 = new JButton("2");
        b15 = new JButton("3");
        b16 = new JButton("+");
        b17 = new JButton("AC");
        b18 = new JButton("0");
        b19 = new JButton(".");
        b20 = new JButton("=");

      MouseEveLis me = new MouseEveLis(this.up);

        b1.addMouseListener(me);
        b2.addMouseListener(me);
        b3.addMouseListener(me);
        b4.addMouseListener(me);
        b5.addMouseListener(me);
        b6.addMouseListener(me);
        b7.addMouseListener(me);
        b8.addMouseListener(me);
        b9.addMouseListener(me);
        b10.addMouseListener(me);
        b11.addMouseListener(me);
        b12.addMouseListener(me);
        b13.addMouseListener(me);
        b14.addMouseListener(me);
        b15.addMouseListener(me);
        b16.addMouseListener(me);
        b17.addMouseListener(me);
        b18.addMouseListener(me);
        b19.addMouseListener(me);
        b20.addMouseListener(me);

        this.add(b1);
        this.add(b2);
        this.add(b3);
        this.add(b4);
        this.add(b5);
        this.add(b6);
        this.add(b7);
        this.add(b8);
        this.add(b9);
        this.add(b10);
        this.add(b11);
        this.add(b12);
        this.add(b13);
        this.add(b14);
        this.add(b15);
        this.add(b16);
        this.add(b17);
        this.add(b18);
        this.add(b19);
        this.add(b20);
    }

}
